
const querystring= require('querystring');


module.exports = app => {
    return {
        schedule: {
            interval: 10000000000,
            type: 'all',
            immediate: false,
            disable: true,
          },
        async task(ctx) {
            var obj = {'startFrom':0, 'latestDate':Date.parse('1800-01-01'), 'totalNums': '0', 'status': '(ACT PEND)'}
            
            var ll = ["USTM", "CATM", "DETM", "FRTM", "UKTM", "ITTM", "ESTM", "AUTM", "MXTM", "JPTM", "WOTM"]
            ll.forEach(async function dd(item) {
                await ctx.app.redis.hset('tortious-config', item, querystring.stringify(obj));
            })
            ctx.app.redis.set('tortious_status', '1');
        }
    }
}